Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: add ability to getattribute of int64 and uint64 data #3555

Merged
merged 1 commit into from
Sep 16, 2022

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Sep 15, 2022

Just a couple missing pieces were preventing getattribute() from retrieving attributes that were stored as int64 or uint64. That doesn't come up very often, but one place is retrieving certain statistics that use 64 bit counters. (This comes up in ImageCache, among other places.)

While we're at it, there was no existing test dedicated to the python binding of ImageCache. So to add these getattribute calls, I made one.

There is an important caveat about ImageCache.getattribute(): In this process, I discovered that the flavor of IC.getattribute(name) where you only pass the name is BROKEN, and will always return None. You MUST use the form where you pass the type, like

x = ic.getattribute("foo", "int")

This is unfortunate and not very Pythonic, but it is the workaround for now. I will addess getting the name-only form working in a separate PR.

Closes #3537

Just a couple missing pieces were preventing getattribute() from
retrieving attributes that were stored as int64 or uint64. That
doesn't come up very often, but one place is retrieving certain
statistics that use 64 bit counters. (This comes up in ImageCache,
among other places.)

While we're at it, there was no existing test dedicated to the python
binding of ImageCache. So to add these getattribute calls, I made one.

There is an important caveat about ImageCache.getattribute(): In this
process, I discovered that the flavor of IC.getattribute(name) where
you only pass the name is BROKEN, and will always return None. You
MUST use the form where you pass the type, like

    x = ic.getattribute("foo", "int")

This is unfortunate and not very Pythonic, but it is the workaround
for now. I will addess getting the name-only form working in a
separate PR.

Closes AcademySoftwareFoundation#3537
@lgritz lgritz merged commit a2e7ec7 into AcademySoftwareFoundation:master Sep 16, 2022
@lgritz lgritz deleted the lg-pyint64 branch September 16, 2022 22:34
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Sep 18, 2022
…SoftwareFoundation#3555)

Just a couple missing pieces were preventing getattribute() from
retrieving attributes that were stored as int64 or uint64. That
doesn't come up very often, but one place is retrieving certain
statistics that use 64 bit counters. (This comes up in ImageCache,
among other places.)

While we're at it, there was no existing test dedicated to the python
binding of ImageCache. So to add these getattribute calls, I made one.

There is an important caveat about ImageCache.getattribute(): In this
process, I discovered that the flavor of IC.getattribute(name) where
you only pass the name is BROKEN, and will always return None. You
MUST use the form where you pass the type, like

    x = ic.getattribute("foo", "int")

This is unfortunate and not very Pythonic, but it is the workaround
for now. I will addess getting the name-only form working in a
separate PR.

Closes AcademySoftwareFoundation#3537
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Sep 23, 2022
Changes since RC1:

  - ImageCache/TextureSystem both have added a `getattributetype()`
    method, which retrieves just the type of a named attribute. AcademySoftwareFoundation#3559
    (2.4.4.0)  NOTE: THIS IS AN ABI BREAKING CHANGE
  - Python: Fix the ability to `getattribute()` of int64 and uint64
    metadata or attributes. AcademySoftwareFoundation#3555 (2.4.4.0)
  - Build: Improvements to the generated cmake config files when
    building static libraries. AcademySoftwareFoundation#3552 AcademySoftwareFoundation#3557 (2.4.4.0)
  - Support for gcc 12.1. AcademySoftwareFoundation#3480 (2.4.2.1) AcademySoftwareFoundation#3551 (2.4.4.0)
  - Support building with clang 15.0. AcademySoftwareFoundation#3563 (2.4.4.0)
  - Fix cross-compiling on Android failing due to `-latomic` check. AcademySoftwareFoundation#3560
    (2.4.4.0)
  - Fix building on iOS. AcademySoftwareFoundation#3562 (2.4.4.0)
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request Sep 23, 2022
Changes since RC1:

  - ImageCache/TextureSystem both have added a `getattributetype()`
    method, which retrieves just the type of a named attribute. AcademySoftwareFoundation#3559
    (2.4.4.0)  NOTE: THIS IS AN ABI BREAKING CHANGE
  - Python: Fix the ability to `getattribute()` of int64 and uint64
    metadata or attributes. AcademySoftwareFoundation#3555 (2.4.4.0)
  - Build: Improvements to the generated cmake config files when
    building static libraries. AcademySoftwareFoundation#3552 AcademySoftwareFoundation#3557 (2.4.4.0)
  - Support for gcc 12.1. AcademySoftwareFoundation#3480 (2.4.2.1) AcademySoftwareFoundation#3551 (2.4.4.0)
  - Support building with clang 15.0. AcademySoftwareFoundation#3563 (2.4.4.0)
  - Fix cross-compiling on Android failing due to `-latomic` check. AcademySoftwareFoundation#3560
    (2.4.4.0)
  - Fix building on iOS. AcademySoftwareFoundation#3562 (2.4.4.0)

Note that we bumped the version to from 2.4.3.x 2.4.4.0 to reflect the
ABI break introduced by the last minute by the IC/TS addition of a new
virtual function. ABI will not change again for 2.4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Cannot read all attribute types via Python
1 participant